package com.eyaomall.wxmall.service.impl;

import java.math.BigDecimal;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eyaomall.wxmall.dao.EmployeeDepositDao;
import com.eyaomall.wxmall.model.vo.EmployeesDepositVO;
import com.eyaomall.wxmall.service.EmployessDepositService;
import com.lycheeframework.core.cmp.kit.IHTTPObject;
import com.lycheeframework.core.cmp.kit.Pages;

@Service
public class EmployeeDepositServiceImpl implements EmployessDepositService {
	
	@Autowired
	private EmployeeDepositDao employeeDepositDao;
	
	
	/**
	 * 店员推广分页
	 */
	public Pages<?> page(EmployeesDepositVO employeesDeposit, IHTTPObject httpObject) {
		
		return employeeDepositDao.page(employeesDeposit, httpObject);
	}

	/**
	 * 统计总提成比例
	 * @param employeeId
	 * @return
	 */
	public BigDecimal sum(Integer employeeId){
		EmployeesDepositVO employeesDeposit = new EmployeesDepositVO();
		employeesDeposit.setEmployeeId(employeeId);
		
		return (BigDecimal) employeeDepositDao.query("sum",employeesDeposit);
	}
}
